package kr.pe.johnkim.checkmileage.mobile.rest.service;

import kr.pe.johnkim.checkmileage.mobile.domain.CheckMileageMemberMileageLog;
import kr.pe.johnkim.checkmileage.mobile.rest.dao.CheckMileageMemberMileageLogDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Check Mileage 사용자 마일리지 로그 관련 Service 기능들을 구현하는 클래스 이다.
 *
 * @author : johnkim <cale9797@gmail.com / Bettersoft, Inc.>
 * @Date : 12. 7. 25
 */
public class CheckMileageMemberMileageLogServiceImpl implements CheckMileageMemberMileageLogService {

    // SLF4J Logging
	private Logger logger = LoggerFactory.getLogger(CheckMileageMemberMileageLogServiceImpl.class);

    @Autowired
    private CheckMileageMemberMileageLogDao checkMileageMemberMileageLogDao = null;

    /**
     * 사용자 마일리지 이력을 저장 한다.
     *
     * @param checkMileageMemberMileageLog
     */
    @Override
    public void registerLog(CheckMileageMemberMileageLog checkMileageMemberMileageLog) throws Exception {
        logger.info("registerLog");

        checkMileageMemberMileageLogDao.registerLog(checkMileageMemberMileageLog);
    }

    /**
     * 특정 업체에 대한 마일리지 이력을 가져 온다.
     *
     * @param checkMileageMemberMileageLog
     * @return
     */
    @Override
    public List<CheckMileageMemberMileageLog> selectMemberMileageLogList(CheckMileageMemberMileageLog checkMileageMemberMileageLog) {
        logger.info("selectMemberMileageLogList");

        return checkMileageMemberMileageLogDao.selectMemberMileageLogList(checkMileageMemberMileageLog);
    }
}
